<?php
session_start();
header("Cache-control: private");
include_once("includes/session.php");

//Linha para formatação de caracteres com acentuação
header("Content-Type: text/html; charset=ISO-8859-1",true);
?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>| <?php print $EMPRESA_SERVICO .' - '. $TIPO_SISTEMA ?> |</title>
<link rel="stylesheet" type="text/css" href="includes/css/azul.css">
<link rel="stylesheet" type="text/css" href="includes/css/autocomplete.css">
<script language="javascript" type="text/javascript" src="includes/js/jquery-1.4.4.js"></script>
<script language="javascript" type="text/javascript" src="includes/js/autocomplete.js"></script>

<script language="javascript" type="text/javascript" src="javascript/inicial.js"></script>
<script language="javascript" type="text/javascript" src="includes/js/funcoes.js"></script>


<script type="text/javascript" src="includes/calendario/date.js"></script>
<!--[if IE]><script type="text/javascript" src="includes/calendario/jquery.bgiframe.js"></script><![endif]-->
<script language="javascript" type="text/javascript" src="includes/calendario/jquery.datePicker.js"></script>
<script language="javascript">

// Indentifica o User Agent do navegador cliente
// AAA - Out 09

var ua = navigator.userAgent.toLowerCase();

var uMobile = '';


// === REDIRECIONAMENTO PARA iPhone, Windows Phone, Android, etc. ===

// Lista de substrings a procurar para ser identificado como mobile WAP
uMobile = '';
uMobile += 'iphone;ipod;windows phone;android;iemobile 8';

// Sapara os itens individualmente em um array
v_uMobile = uMobile.split(';');

// percorre todos os itens verificando se eh mobile
var boolMovel = false;
for (i=0;i<=v_uMobile.length;i++)
{
        if (ua.indexOf(v_uMobile[i]) != -1)
        {
                boolMovel = true;
        }
}

if (boolMovel == true)
        {
                location.href='php/mobile/agenda.php';
				//location.href='http://creci.kinghost.net/dev2/menu_principal2.php';
        }
</script>


<link rel="stylesheet" type="text/css" href="includes/calendario/datePicker.css">

<?php
	extract($_GET);
	if(!isset($m))
		$m = 1;
	
	$not->sql = "SELECT * FROM menu
					WHERE id = $m";
					
	if($not->ler() > 0){
		$not->ini();
	
		$dir = opendir('javascript/'. $not->ds_dir);
		while(false !== ($nome_arquivo = readdir($dir))){
			if(!is_dir($nome_arquivo))
				print "<script type='text/javascript' src='javascript/".$not->ds_dir."/".$nome_arquivo."'></script>\n";
		}
	}
?>

</head>

<body topmargin="0" leftmargin="0" rightmargin="0" marginheight="0" marginwidth="0">

<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="50%" background="imagens/topo_centro.jpg" valign="middle" height="35" align="left"> 
&nbsp;&nbsp;
<font color="#FFFFFF" face="Arial, Helvetica, sans-serif" size="2">
<b>| <?php echo $EMPRESA; ?> |  <?php print $_SESSION['TIPO_SISTEMA'] ?> </b>
</font>

</td>

<td width="50%" background="imagens/topo_centro.jpg" valign="middle" height="35" align="right"> 
<font color="#FFFFFF" face="Arial, Helvetica, sans-serif" size="2">
<b>Usu&aacute;rio logado: <?php echo $NOME_COMPLETO; ?></b>
</font>
&nbsp;&nbsp;
</td>
</tr>
</table>
<br />
<?php include("menu_principal.php"); ?>

<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="20%" valign="top"><?php include("sub_menu_principal.php"); ?></td>
<td width="80%" valign="top" align="center">

<div id="telas" style="width:95%; height:95%;">

</div>

</td>
</tr>
</table>


</body>
</html>